<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery.getJSON demo</title>
  <style>
  img {
    height: 100px;
    float: left;
  }
  </style>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<div id="images"></div>
 
<script>
var categories = [] ;
$.getJSON( "json/categories.json", function( json ) {
	  console.log( "JSON Data: " + json[0].name );

	   jQuery.each(json, function(key, val) {
		  console.log(val.name);
		  categories[val.categoryId]=val.name;
		   
	   });	 
	   console.log("cats " + categories[7]);	 
	 }); 

</script>
 
</body>
</html>